Skip to content

GetPlayerWeaponState #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 19, 2020
Merged

Conversation

Disinterpreter
Copy link
Member

fix #19

mta-screen_2020-06-17_17-01-33

Comment on lines 2966 to 2967
-- Someone tell me how can I transfer the value of this vars to the server?
clientCall(player, '_isPedReloadingWeapon', player)
Copy link
Contributor

@qaisjp qaisjp Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way it would work is that there's an event client-side like onClientPedReload -- and in that event, sync it to the server. Did you test whether this would work?

I think this function will always return the result of the previous call.


I think we should just try to implement https://wiki.multitheftauto.com/wiki/IsPedReloadingWeapon server-side in MTA

My suggestion for now is that we just never return 3, and when we've implemented stuff in MTA, we can add the return 3.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just try to implement https://wiki.multitheftauto.com/wiki/IsPedReloadingWeapon server-side in MTA

I'll be wait it with pleasure!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way it would work is that there's an event client-side like onClientPedReload -- and in that event, sync it to the server. Did you test whether this would work?

The part of the code with reloading a gun is working. I have tested it. (You can see it at my screenshot)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no guarantee that the reloading state will be updated between line 2967 and 2968. The event call involves networking with the client and is an asynchronous operation.

Disinterpreter and others added 2 commits June 17, 2020 21:30
Co-authored-by: Qais Patankar <qaisjp@gmail.com>
Co-authored-by: Qais Patankar <qaisjp@gmail.com>
@Disinterpreter Disinterpreter marked this pull request as draft June 17, 2020 18:33
Disinterpreter and others added 3 commits June 17, 2020 21:36
Co-authored-by: Qais Patankar <qaisjp@gmail.com>
Co-authored-by: Qais Patankar <qaisjp@gmail.com>
Co-authored-by: Qais Patankar <qaisjp@gmail.com>
@Disinterpreter
Copy link
Member Author

Ok. What we will do with it?

  1. We can merge it (It really worked for me)
  2. We can remove 'return 3'
  3. We will wait server side of the function

I suggest the first variant.

@Disinterpreter Disinterpreter marked this pull request as ready for review June 18, 2020 19:09
@qaisjp
Copy link
Contributor

qaisjp commented Jun 18, 2020

Comment left on thread -- #41 (comment)

I don't think it will work reliably. E.g. over the internet the event call will be too slow

@Disinterpreter
Copy link
Member Author

Comment left on thread -- #41 (comment)

I don't think it will work reliably. E.g. over the internet the event call will be too slow

Okay. Just we leave it without 3 state as you suggested in #41 (comment)

@qaisjp qaisjp merged commit 903f1ff into multitheftauto:develop Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetPlayerWeaponState
2 participants